package code;
import java.util.Scanner;

public class 数字炸弹20489 {
// 1:无需package
// 2: 类名必须Main, 不可修改
        public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            int M,N;
            N=scan.nextInt();
            M=scan.nextInt();
            int goal=0;
            for (int i = 2; i < 50; i++) {
                M=i;
                M-=1;
                if(M==0){
                    System.out.println(1);
                    return ;
                }
                int mid=M/(N-1);//完整的来回数
                int middle=M%(N-1);//最后一个回合后的剩余数
                System.out.println("i="+i+" "+"mid="+mid+" "+"middle="+middle);
                if(mid%2==0){
                    System.out.println(middle+1);
                }
                else{
                    System.out.println(N-middle);
                }
            }
            scan.close();
        }
}
